package com.jydd.singlekotlinmvvm.comm.feature.main.controller

import com.airbnb.epoxy.TypedEpoxyController
import com.jydd.singlekotlinmvvm.comm.model.response.RepoInfo

/**
 * created by 韦敏敏
 * on 2020/1/22
 */
class RepoController(private val itemClick: (item : RepoInfo) -> Unit) :
    TypedEpoxyController<List<RepoInfo>>() {
    override fun buildModels(data: List<RepoInfo>?) {
       data?.forEach {
           RepoModel(it){
               itemClick.invoke(it)
           }.id(it.id)
               .addTo(this)
       }
    }
}